package test;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

public class JieCeng {
	static int jc(int m) {
		int sum = 1;
		for (int i = 1; i <= m; i++) {
			sum *= i;
		}
		return sum;
	}

	public static void main(String[] args) {
		String str = "";
		int sum = 0;
		int n = 1;
		// System.out.println(jc(14));
		Scanner sc = new Scanner(System.in);
		while (n != 0) {
			str = "";
			sum = 0;
			n = sc.nextInt();

			for (int i = 1; i <= n; i++) {
				sum += jc(i);
				if (i < n)
					str += i + "!+";
				else
					str += i + "!=";
			}
			System.out.println(str + sum);
		}
	}

}
